home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / coolmetal-logo.scm.z / coolmetal-logo.scm
Encoding:
GIMP Script-Fu Script  |  1999-07-21  |  4.6 KB  |  114 lines

  1. ;  COOL-METAL
  2. ;  Create a text effect that looks like metal with a reflection of
  3. ;  the horizon, a reflection of the text in the mirrored ground, and
  4. ;  an interesting dropshadow
  5. ;  This script was inspired by Rob Malda's 'coolmetal.gif' graphic
  6.  
  7. (define (script-fu-cool-metal-logo text size font bg-color seascape)
  8.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  9.      (feather (/ size 5))
  10.      (smear 7.5)
  11.      (period (/ size 3))
  12.      (amplitude (/ size 40))
  13.      (shrink (+ 1 (/ size 30)))
  14.      (depth (/ size 20))
  15.      (text-layer (car (gimp-text img -1 0 0 text 0 TRUE size PIXELS "*" font "*" "*" "*" "*")))
  16.      (width (car (gimp-drawable-width text-layer)))
  17.      (height (car (gimp-drawable-height text-layer)))
  18.      (img-width (+ width (* 0.15 height) 10))
  19.      (img-height (+ (* 1.85 height) 10))
  20.      (bg-layer (car (gimp-layer-new img img-width img-height RGB_IMAGE "Background" 100 NORMAL)))
  21.      (shadow-layer (car (gimp-layer-new img img-width img-height RGBA_IMAGE "Shadow" 100 NORMAL)))
  22.      (reflect-layer (car (gimp-layer-new img width height RGBA_IMAGE "Reflection" 100 NORMAL)))
  23.      (channel 0)
  24.      (fs 0)
  25.      (layer-mask 0)
  26.      (old-gradient (car (gimp-gradients-get-active)))
  27.      (old-fg (car (gimp-palette-get-foreground)))
  28.      (old-bg (car (gimp-palette-get-background))))
  29.     (gimp-image-disable-undo img)
  30.     (gimp-image-resize img img-width img-height 0 0)
  31.     (gimp-image-add-layer img bg-layer 1)
  32.     (gimp-image-add-layer img reflect-layer 1)
  33.     (gimp-image-add-layer img shadow-layer 1)
  34.     (gimp-layer-set-preserve-trans text-layer TRUE)
  35.  
  36.     (gimp-palette-set-background bg-color)
  37.     (gimp-edit-fill img bg-layer)
  38.     (gimp-edit-clear img reflect-layer)
  39.     (gimp-palette-set-background '(0 0 0))
  40.     (gimp-edit-fill img shadow-layer)
  41.  
  42.     (if (= seascape 1)
  43.     (gimp-gradients-set-active "Horizon_2")
  44.     (gimp-gradients-set-active "Horizon_1"))
  45.     (gimp-blend img text-layer CUSTOM NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 0 0 0 (+ height 5))
  46.     (gimp-rect-select img 0 (- (/ height 2) feather) img-width (* 2 feather) REPLACE 0 0)
  47.     (plug-in-gauss-iir 1 img text-layer smear TRUE TRUE)
  48.     (gimp-selection-none img)
  49.     (plug-in-ripple 1 img text-layer period amplitude 1 0 1 TRUE FALSE)
  50.     (gimp-layer-translate text-layer 5 5)
  51.     (gimp-layer-resize text-layer img-width img-height 5 5)
  52.  
  53.     (gimp-selection-layer-alpha img text-layer)
  54.     (set! channel (car (gimp-selection-save img)))
  55.     (gimp-selection-shrink img shrink)
  56.     (gimp-selection-invert img)
  57.     (plug-in-gauss-rle 1 img channel feather TRUE TRUE)
  58.     (gimp-selection-layer-alpha img text-layer)
  59.     (gimp-selection-invert img)
  60.     (gimp-palette-set-background '(0 0 0))
  61.     (gimp-edit-fill img channel)
  62.     (gimp-selection-none img)
  63.  
  64.     (plug-in-bump-map 1 img text-layer channel 135 45 depth 0 0 0 0 FALSE FALSE 0)
  65.  
  66.     (gimp-selection-layer-alpha img text-layer)
  67.     (set! fs (car (gimp-selection-float img shadow-layer 0 0)))
  68.     (gimp-edit-clear img shadow-layer)
  69.     (gimp-perspective img fs FALSE
  70.               (+ 5 (* 0.15 height)) (- height (* 0.15 height))
  71.               (+ 5 width (* 0.15 height)) (- height (* 0.15 height))
  72.               5 height
  73.               (+ 5 width) height)
  74.     (gimp-floating-sel-anchor fs)
  75.     (plug-in-gauss-rle 1 img shadow-layer smear TRUE TRUE)
  76.  
  77.     (gimp-rect-select img 5 5 width height REPLACE FALSE 0)
  78.     (gimp-edit-copy img text-layer)
  79.     (set! fs (car (gimp-edit-paste img reflect-layer FALSE)))
  80.     (gimp-floating-sel-anchor fs)
  81.     (gimp-scale img reflect-layer FALSE 0 0 width (* 0.85 height))
  82.     (gimp-flip img reflect-layer 1)
  83.     (gimp-layer-set-offsets reflect-layer 5 (+ 3 height))
  84.  
  85.     (set! layer-mask (car (gimp-layer-create-mask reflect-layer WHITE-MASK)))
  86.     (gimp-image-add-layer-mask img reflect-layer layer-mask)
  87.     (gimp-palette-set-foreground '(255 255 255))
  88.     (gimp-palette-set-background '(0 0 0))
  89.     (gimp-blend img layer-mask FG-BG-RGB NORMAL LINEAR 100 0 REPEAT-NONE
  90.         FALSE 0 0 0 (- (/ height 2)) 0 height)
  91.  
  92.     (gimp-image-remove-channel img channel)
  93.  
  94.     (gimp-layer-set-name text-layer text)
  95.     (gimp-gradients-set-active old-gradient)
  96.     (gimp-palette-set-background old-bg)
  97.     (gimp-palette-set-foreground old-fg)
  98.     (gimp-image-enable-undo img)
  99.     (gimp-display-new img)))
  100.  
  101.  
  102. (script-fu-register "script-fu-cool-metal-logo"
  103.             "<Toolbox>/Xtns/Script-Fu/Logos/Cool Metal"
  104.             "Metallic logos with reflections and perspective shadows"
  105.             "Spencer Kimball & Rob Malda"
  106.             "Spencer Kimball & Rob Malda"
  107.             "1997"
  108.             ""
  109.             SF-VALUE "Text String" "\"Cool Metal\""
  110.             SF-VALUE "Font Size (in pixels)" "100"
  111.             SF-VALUE "Font" "\"Crillee\""
  112.             SF-COLOR "Background Color" '(255 255 255)
  113.             SF-TOGGLE "Seascape" FALSE)
  114.